Integration Guide ABB (IRC5) LS
Note: Read the Robot communication overview before you read this integration guide.
Note 2: Use the latest version of this integration guide. It is included in the latest version of the Robot module. You can download the Robot module from the official Photoneo website.
This guide describes the Locator Studio (LS) Robot module LS 1.5.0 for ABB robots with the IRC5 controller. For the OmniCore controller, see Integration Guide ABB (OmniCore) LS.
Contents
1 Prerequisites
IRC5 robot controller with RobotWare 5.13 or higher (RobotWare 5.x and 6.x). The module was developed and tested on RobotWare 6.08.02.
Option (616-1) PC Interface - provides the RAPID socket instructions used by the module.
RobotStudio for installation. Version 2025.4 or higher is recommended.
The LS module has no Robot State Server. It runs in one normal motion task (T_ROB1), so the (623-1) Multitasking option is not needed.
To check that the option is installed, go to System Info -> System Properties -> Control Module -> Options:
2 Robot controller setup
2.1 Controller configuration
2.1.1 Network configuration
Recommended use of the IRC5 Ethernet ports:
WAN port - connection to the Photoneo vision controller.
Service port - connection to the PC with RobotStudio. The service port has the fixed address 192.168.125.1 and runs a DHCP server, so do not connect it to a plant network.
Note: The procedure below is for RobotWare 6 and higher. RobotWare 5 uses a different procedure to set the IP address. See the ABB documentation for your RobotWare version.
Turn on the IRC5 controller and wait for the start screen. Open the Menu and select Control Panel:
In the Control Panel, select Controller Settings:
Select Settings and choose Network:
Use the keypad to set the IP address and subnet mask of the WAN port:
Confirm with OK and restart the controller to apply the new settings:
The robot controller and the vision controller must be in the same subnet. For example:
Vision controller: 192.168.1.1 / 24
Robot controller (WAN): 192.168.1.2 / 24
Enter the robot controller IP address on the Network page of the vision controller. Click Test connection to ping the robot controller.
2.1.2 Tool setup
The example programs use the tool pho_tool. Each example program declares it as TASK PERS tooldata. Set pho_tool to match your gripper before you teach any poses. Open Jogging -> Tool, select pho_tool and use Edit -> Change Value.
Rules for frames:
Object poses are
robtargetvalues in the robot base frame. Pick them with the real tool (for examplepho_tool) andwobj0.Poses sent to the vision controller (calibration points, hand-eye scan poses) must be the flange pose (
tool0) inwobj0.
2.2 Robot module installation
2.2.1 Loading the Robot module files
The Robot module is delivered as Photoneo_LS_Module_1_5_0.zip. It contains these files:
File |
Purpose |
|---|---|
|
System module with the communication driver and the robotic API. Required. Do not edit. |
|
12 example program modules - see Example programs. Optional. |
Copy the files to the controller with a USB stick or with RobotStudio:
Set the PC to DHCP, connect it to the Service port and start RobotStudio.
On the Controller tab select One Click Connect (or Add Controller) and log in as Default User.
On the Controller tab, open File Transfer. Create a folder on the controller, for example
HOME:/Photoneo_LS_1_5/. CopyPHO_LS_BASE.sysand the example programs that you need into this folder.
2.2.2 Loading the modules into the T_ROB1 task
In RobotStudio, click Request write access. Right-click the T_ROB1 task and select Load Module from Controller. Select these modules:
PHO_LS_BASE.sysone main program, for example
PHO_LS_Basic.moda calibration program (optional), for example
PHO_LS_Calibration_Basic.mod
Load only one main program at a time. Every main program declares its own main routine and the variables pho_tool, home_pose, start_pose and vision_system_id. Two main programs in the same task cause a name conflict. The calibration programs have no main routine. Their entry routine is calibration_main. They use pho_tool and vision_system_id of the loaded main program (PHO_LS_Calibration_Basic.mod also uses home_pose).
After you load the modules, the RAPID tree looks like this:
Tip: To keep the system module loaded after a RAPID reset, add PHO_LS_BASE.sys to Configuration -> Controller -> Automatic Loading of Modules (File: path to PHO_LS_BASE.sys, Task: T_ROB1).
3 Robot module
All Photoneo routines, variables and constants are declared in PHO_LS_BASE.sys. The module is NOSTEPIN and VIEWONLY. Do not edit it. Your robot program only calls the routines described below.
3.1 Robotic API
Most requests exist in two forms:
A procedure (
PROC), for examplepho_get_objects. It stores the error code in the global variablePHO_ERR_CODE. The example programs use this form.A function (
FUNC num), for examplepho_request_get_objects. It returns the error code.
Both forms do the same thing. 0 (PHO_NO_ERR) means success. For the other codes, see Error codes defined by the module.
3.1.1 Connection procedures
Function |
Description |
|---|---|
FUNC num pho_wait_for_server(string server_ip,\num port_number,\num wait_time) |
Opens the TCP connection to the Action Request Server on the vision controller and sends the brand ID. If a connection is already open, the function closes it first. This means that you can also use it to reconnect.
Returns: Call it once at the start of the program. You can send requests only after the connection is established. status := pho_wait_for_server("192.168.1.1", \wait_time:=20);
|
3.1.2 Communication procedures
For a description of what each request does on the vision controller, see Action requests.
Locator requests
Request |
ID |
Procedure / function |
Inputs |
Outputs |
|---|---|---|---|---|
19 |
|
|
none - the response is read by Wait for scan completion |
|
30 |
|
|
none - the response is read by the next request or by Wait for scan completion |
|
31 |
|
|
none - the response is read by Wait for scan completion |
|
20 |
PROC pho_get_objectsFUNC pho_request_get_objects |
|
|
|
Get objects - all objects |
20 |
PROC pho_get_all_objectsFUNC pho_request_get_all_objects |
|
|
Get objects - one object |
20 |
PROC pho_get_single_objectFUNC pho_request_get_single_object |
|
|
22 |
PROC pho_get_vs_statusFUNC pho_request_get_vs_status |
|
|
|
33 |
PROC pho_change_bboxFUNC pho_request_change_bbox |
|
error code only |
\robtarget pose is optional. Send it only for a hand-eye (robot-mounted) vision system. It is the flange pose (tool0, wobj0) at which the scan is taken. For hand-eye multiview, pho_reuse_scan needs the pose of the first scan in the sequence.
Set num_of_req_objects = 0 to request all objects. The results array must be large enough for all returned objects (the module can store up to 100).
Calibration requests
Request |
ID |
Procedure / function |
Inputs |
Outputs |
|---|---|---|---|---|
5 |
PROC pho_calib_add_pointFUNC pho_request_calib_add_point |
|
error code only |
|
25 |
PROC pho_calib_startFUNC pho_request_calib_start |
|
error code only |
|
27 |
PROC pho_calib_saveFUNC pho_request_calib_save |
none |
|
|
26 |
PROC pho_calib_stopFUNC pho_request_calib_stop |
none |
error code only |
Solution requests
Request |
ID |
Procedure / function |
Inputs |
Outputs |
|---|---|---|---|---|
9 |
PROC pho_change_solutionFUNC pho_request_change_solution |
|
error code only |
|
10 |
PROC pho_start_solutionFUNC pho_request_solution_start |
|
error code only |
|
11 |
PROC pho_stop_solutionFUNC pho_request_solution_stop |
none |
error code only |
|
12 |
|
none |
|
Other requests
Request |
ID |
Procedure / function |
Inputs |
Outputs |
|---|---|---|---|---|
100 |
PROC pho_comm_checkFUNC pho_request_comm_check |
none |
error code only |
Examples:
! Procedure form - error code in PHO_ERR_CODE
pho_get_all_objects vision_system_id, targets, num_of_targets;
IF PHO_ERR_CODE <> PHO_NO_ERR THEN
...
ENDIF
! Function form - error code returned
status := pho_request_change_bbox(1, 2);
3.1.3 Response receiving procedures
The Scan, Trigger scan and Localize on the last scan requests only send the request. With a hand-eye sensor, keep the robot still until the scan response arrives. With an extrinsic sensor, the robot can move in the meantime if it stays out of the scanned scene. The only exception is dynamic MultiView, where the sensor scans while the robot moves. To read the response, use:
Procedure / function |
Description |
|---|---|
PROC pho_wait_for_scan_completion(\num wait_time)FUNC num pho_request_wait_for_scan(\num wait_time) |
Wait for scan completion. Waits for the response to the last scan request. |
The next request also reads the response to a Trigger scan request automatically. This means that you can send several Trigger scan requests in a row (see PHO_LS_Multiview_Static.mod).
3.1.4 Auxiliary functions
Function |
Description |
|---|---|
|
Returns |
|
Returns a short text for an error code, for example |
3.1.5 Info data
Some responses contain extra values, called Info data. The module stores them in these PERS variables:
Key |
Info data |
Variable |
Unit in robot |
|---|---|---|---|
4 |
Dimension X |
|
mm |
5 |
Dimension Y |
|
mm |
6 |
Rotation Z |
|
deg (converted from mrad) |
7 |
Neural network label |
|
integer |
8 |
Max Z height |
|
mm |
9 |
Tilt |
|
deg (converted from mrad) |
10 |
Calibration accuracy |
|
µm |
11 |
Running solution ID |
|
integer |
12 |
Number of localized objects |
|
integer |
13 |
Number of ready objects |
|
integer |
14 |
Processing state |
|
0 / 1 |
{n} is the index of the object in the results array of the Get objects request. pho_nn_label, pho_max_height and pho_angle are single values. They hold the value of the last object in the response. The vision controller sends the values only if the solution provides them. Read them only after the request returns 0.
3.1.6 Variables used by the module
In addition to the Info data variables above, PHO_LS_BASE.sys declares:
Variable / constant |
Meaning |
|---|---|
|
Error code of the last request called in procedure form. |
|
Calibration result (camera pose) received from the Save automatic calibration result request. |
|
Request IDs: |
The example programs declare pho_tool (TASK PERS tooldata), home_pose, start_pose and vision_system_id themselves.
3.1.7 Error codes defined by the module
Use these constants instead of numbers. For descriptions and troubleshooting, see Error codes.
Constant |
Value |
Meaning |
|---|---|---|
|
0 |
No error |
|
2 |
Unknown request |
|
3 |
Communication error |
|
4 |
Bad data |
|
5 |
Timeout |
|
450 |
Invalid solution ID |
|
451 |
Another solution running |
|
452 |
Deployment not started |
|
453 |
Deployment is not running |
|
454 |
Deployment did not stop |
|
455 |
Solution is not complete |
|
457 |
Invalid robot brand |
|
458 |
Solution already running |
|
459 |
Solution access unauthorized |
|
460 |
Invalid vision system ID |
|
461 |
Calibration already running |
|
462 |
Calibration not running |
|
463 |
Calibration did not stop |
|
464 |
Calibration did not start |
|
465 |
Automatic calibration disabled |
|
466 |
Not enough calibration points |
|
467 |
Calibration accuracy is above the threshold |
|
468 |
Scanner not available |
|
469 |
Calibration forbidden |
|
500 |
Vision system not found |
|
501 |
Empty scene |
|
502 |
No object found, detection still running |
|
503 |
No object found, detection stopped |
|
504 |
All objects rejected, detection still running |
|
505 |
All objects rejected, detection stopped |
The module passes other codes from the vision controller through as numbers (for example 506-511 or calibration point errors 100-134).
3.2 Example programs
All example programs are in rapid/example_programs. Each one connects to the vision controller at 192.168.1.1. Change the IP address in the pho_wait_for_server call. All robot poses are set to an unreachable value ([99999, 99999, 99999]). Teach them before the first run.
Example program |
Purpose |
|---|---|
|
Basic workflow: scan, get all objects, pick them in a loop, scan again. |
|
Same as Basic, for a robot-mounted scanner. Sends the scan pose with the Scan request. |
|
Calibration with 9 taught poses; starts, saves and stops automatic calibration ( |
|
Calibration with 9 poses in an array. Checks that all poses were taught and limits acceleration. Automatic calibration is off by default ( |
|
Same as Basic, but switches between bounding box 1 and 2 after each cycle. |
|
Same as Basic, but switches between solution 1 and 2 after each cycle. |
|
Same as Basic, but reads the vision system status (localized / ready objects) while the scan is running. |
|
Same as Basic, but alternates between vision system 1 and 2. |
|
Scans with vision system 1, then localizes again on the same scan with vision system 2 ( |
|
Hand-eye multiview: stops at 3 poses and sends a Trigger scan request at each pose. Then starts localization with a Scan request. |
|
Hand-eye multiview while moving (MotionCam-3D): a timer interrupt ( |
|
Sends Communication check requests in a loop and reconnects on failure. The robot moves only to the home pose. |
3.2.1 Main program example
In PHO_LS_Basic.mod, the robot:
connects to the vision controller,
moves to
home_pose(out of the scanner view) and sends the Scan request,waits for the scan and requests all object poses,
scans again on error 502 / 503 / 504 / 505, and stops with an event log message on any other error,
picks every object: approach 50 mm above the object, linear move to the object, gripper command (to be added), retreat, placing (to be added),
scans again.
MODULE PHO_LS_Basic
! Copyright (c) 2026 Zebra Technologies s.r.o.
! All rights reserved
! Description: Locator example with requesting all objects at once
! RobotWare version 5.x-7.x
! ==============================================================================
! LOCATOR BASIC
! ==============================================================================
! This is a basic locator template.
! Program requests all localized objects and then picks them in a loop.
! User is expected to reteach home and start positions,
! and set IP Address of Vision Controller.
! ==============================================================================
!ToolData
TASK PERS tooldata pho_tool := [TRUE, [[0, 0, 0], [1, 0, 0, 0]], [0, [0, 0, 0], [1, 0, 0, 0], 0, 0, 0]];
! Reteach home and start position for your application
VAR robtarget home_pose := [[99999.0, 99999.0, 99999.0], [1, 0, 0, 0], [0, 0, 0, 0], [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]];
VAR robtarget start_pose := [[99999.0, 99999.0, 99999.0], [1, 0, 0, 0], [0, 0, 0, 0], [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]];
! Vision system ID variable
VAR num vision_system_id := 1;
! =========================== MAIN PROGRAM =====================================
PROC main()
VAR robtarget targets{100};
VAR num num_of_targets;
VAR num i;
VAR num status;
! Initialize all targets to unreachable position (Safety measure)
FOR i FROM 1 TO 100 STEP 1 DO
targets{i} := [[99999.0, 99999.0, 99999.0], [1, 0, 0, 0], [0, 0, 0, 0], [9E+09, 9E+09, 9E+09, 9E+09, 9E+09, 9E+09]];
ENDFOR
! Set acceleration
AccSet 20,20;
! Connect to Photoneo Vision Controller, change Vision Controller IP address here if needed
TPWrite "Connecting to Vision Controller...";
status := pho_wait_for_server("192.168.1.1", \wait_time:=20);
IF(status <> PHO_NO_ERR) THEN
TPWrite "Could not connect to Vision Controller";
ELSE
TPWrite "Connected to Vision Controller";
ENDIF
scan_again:
! Move robot away from scanning area - reteach this position for your robot and workcell
MoveJ home_pose, v500, fine, pho_tool;
! When robot is away from scanning area, trigger first scan and localization
pho_request_scan vision_system_id;
! ==================== MAIN LOOP ===========================================
! Wait until scanning is completed
pho_wait_for_scan_completion;
! Handle errors if occured
IF (PHO_ERR_CODE <> PHO_NO_ERR) THEN
ErrLog 4800, "Scan Request Error", "Terminating program", "Check Locator Studio Console", "Error code : " + NumToStr(PHO_ERR_CODE, 0), " ";
EXIT;
ENDIF
! If Scan OK, request object poses
pho_get_all_objects vision_system_id, targets, num_of_targets; !Request all object poses
!pho_get_objects vision_system_id, 1, targets, num_of_targets; !Request specified num of objects (1 here)
! Check errors, rescan if needed
IF (PHO_ERR_CODE = PHO_NO_OBJ_RUN OR PHO_ERR_CODE = PHO_REJECT_RUN) THEN
TPWrite "No object found yet, but localization is still running";
GOTO scan_again;
ELSEIF (PHO_ERR_CODE = PHO_NO_OBJ_STOP) THEN
TPWrite "No object found, but localization finished";
GOTO scan_again;
ELSEIF (PHO_ERR_CODE = PHO_REJECT_STOP) THEN
TPWrite "Objects are rejected by constraints";
GOTO scan_again;
ELSEIF (PHO_ERR_CODE <> PHO_NO_ERR) THEN
ErrLog 4800, "Locator Studio Error", "Terminating program", "Get object pose request returned an error", "Error code : " + NumToStr(PHO_ERR_CODE, 0), " ";
EXIT;
ENDIF
! If no error, print output and proceed to picking
TPWrite "Localized " + NumToStr(num_of_targets, 0) + " objects";
! Move to start_pose
MoveJ start_pose, v100, z30, pho_tool;
! Pick all targets using regular MoveL commands with received targets + approach and deapproach offsets
FOR i FROM 1 TO num_of_targets STEP 1 DO
MoveJ Offs(targets{i}, 0, 0, 50), v100, z10, pho_tool;
MoveL targets{i}, v100, fine, pho_tool;
! Add gripper command here
!SetDO magnet, 1;
MoveL Offs(targets{i}, 0, 0, 50), v100, z10, pho_tool;
! Add placing here
MoveJ start_pose, v100, z30, pho_tool;
ENDFOR
! Repeat the loop
GOTO scan_again;
ENDPROC
ENDMODULE
3.2.2 Calibration example
PHO_LS_Calibration_Basic.mod (entry routine calibration_main) runs the robot-side part of a calibration with 9 poses. LS supports sphere calibration (static scanner) and marker pattern calibration (hand-eye scanner). Both need 9 poses with enough variation in orientation.
Before the first run:
Load it together with a main program. It uses
pho_tool,home_poseandvision_system_idfrom the main program.Teach
calib_pose_1…calib_pose_9. Check that the moves between them are collision-free.Set
solution_idandvision_system_id(default 1).Set
auto_calibration(defaultTRUE). With the default value, the program starts, saves and stops the calibration itself. WithFALSE, start the calibration in LS first and save it there.
Sequence:
pho_wait_for_server- connects to the vision controller.pho_calib_start solution_id, vision_system_id- starts automatic calibration.For each pose:
MoveJ calib_pose_n, waitwait_before_scan(1 s),pho_calib_add_point CRobT(\Tool:=tool0)(the flange pose).pho_calib_save- saves the result. The accuracy is stored inpho_calib_acc(µm), the camera pose inpho_camera_pose.pho_calib_stop- stops automatic calibration.
Note: The pose sent with pho_calib_add_point must be the flange pose (tool0, wobj0). If you use other tool or work object data, the calibration result is wrong.
PHO_LS_Calibration_Expert.mod does the same with the poses in the array calib_poses{9}. It does not run if a pose still has the default value. It limits acceleration with WorldAccLim, and auto_calibration is FALSE by default.
A typical calibration error is below 3 mm. Check the result on the Verification tab in LS. The point cloud must fit the robot model. Common causes of bad results are wrong tool data, a wrong robot model and encoder offsets.
3.3 Error handling
Check the error code (PHO_ERR_CODE or the returned value) after every request and after Wait for scan completion. Codes 502-505 are normal results of the Get objects request (nothing to pick yet, or nothing to pick at all). The example programs simply scan again.
How the module handles communication problems:
Socket not connected or closed by the vision controller - the request returns
PHO_COM_FAILURE(3).No response within the timeout - the request returns
PHO_TIMEOUT(5). The default timeout is 3600 s.Response does not match the request, or has an unknown message type - the module writes event log message 4800 “Photoneo Internal Error” and stops the program (
EXIT). Contact support.Wait for scan completion called without a pending scan - event log message 4800, return value
-1.
To recover from error 3 or 5, call pho_wait_for_server again. It closes the old socket and reconnects (see PHO_LS_Comm_Check.mod). If the connection is refused, check that the solution is deployed and that the IP addresses match.
4 Running the Main program example
4.1 Prerequisites
The LS solution is configured and the vision system is calibrated.
The controller is set up as described in Robot controller setup.
The vision controller IP address is set in
pho_wait_for_server.Gripper and placing commands are added to the program (optional for a first dry run).
4.2 Reteach the robot poses
PHO_LS_Basic.mod uses two poses:
home_pose- the robot requests the scan at this pose. For a static scanner, the robot must not block the scanner view. For a hand-eye scanner, usePHO_LS_Hand_Eye.modand teachscanning_poseinstead.start_pose- usually above the middle of the bin or scanning area. The robot passes through it before and after each pick.
To teach a pose, open Program Data and show the robtarget data in the scope of the module. Jog the robot to the pose, select the variable and press Modify Position. Other example programs have extra poses (for example p1 … p4 in the multiview examples). Teach them the same way.
4.3 Runtime
Deploy your solution. On the Deployment page, the Action Request Client status is DISCONNECTED.
Open Production Window and Set PP to Main:
Select AUTO or MANUAL mode and reduce the speed:
Press Play (AUTO) or Enable + Play (MANUAL). The FlexPendant shows “Connected to Vision Controller” and the Action Request Client status changes to CONNECTED:
The robot now sends requests and moves to the localized objects. Check the path to the first object at low speed. If the robot stops too high or too low, correct the tool data or the object origin in LS.
NOTE: Be ready to stop the robot at any time. Use 10% speed for the first tests.
5 Version and brand ID
Robot module version |
LS 1.5.0 |
Brand ID sent at connection |
|
Action Request Server port |
11003 |
Supported controllers |
IRC5, RobotWare 5.13 - 6.x |
See Robot module support matrix for compatible LS versions.
6 Migration
Changes from LS 1.4 to LS 1.5 are listed in Migration from LS 1.4.x to LS 1.5.x. In short: Info data are now read by key, the new variable pho_nn_label was added and the example program PHO_LS_Comm_Check.mod is new.
